#include "project_config.h"

#include "vtkActor.h" 
#include "vtkCommand.h" 
#include "vtkInteractorStyleTrackballCamera.h" 
#include "vtkPolyDataMapper.h" 
#include "vtkProperty.h"
#include "vtkRenderWindow.h" 
#include "vtkRenderWindowInteractor.h" 
#include "vtkRenderer.h" 
#include "vtkCylinder.h"
#include "vtkCylinderSource.h"

int main(int argc, char** argv[])
{
	//Create a cone source object
	vtkCylinderSource *cylinder = vtkCylinderSource::New();
	cylinder->SetHeight(3.0);
	cylinder->SetRadius(1.0);
	//cylinder->SetResolution(10);//200

	//Create a mapper object
	vtkPolyDataMapper *cylinderMapper = vtkPolyDataMapper::New();
	cylinderMapper->SetInputConnection(cylinder->GetOutputPort());

	//Associate the mapper to an actor object
	vtkActor *cylinderActor = vtkActor::New();
	cylinderActor->SetMapper(cylinderMapper);
	

	//Add the actors to the renderer
	vtkRenderer *ren1 = vtkRenderer::New();
	ren1->AddActor(cylinderActor);
	ren1->SetBackground(0.1, 0.2, 0.4);

	//Create a render window
	vtkRenderWindow *renWin = vtkRenderWindow::New();
	renWin->AddRenderer(ren1);
	renWin->SetSize(600,600);

	//Create an interactor and associate it to the render window
	vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
	iren->SetRenderWindow(renWin);
	iren->Initialize();

	//Define the interacting style
	vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New();
	iren->SetInteractorStyle(style);

	//Start to interact
	iren->Start();

	return 0;
}


